package com.sakura.probe.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sakura.probe.pojo.Comment;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CommentMapper extends BaseMapper<Comment> {

    /**
     * 根据帖子ID获取相关评论
     * @param comment
     * @return
     */
    List<Comment> queryComment(@Param("commentCondition") Comment comment,
                               @Param("rowIndex") int rowIndex, @Param("pageSize") int pageSize);


    /**
     * 获取评论的数量
     * @return
     */
    Long queryCommentCount(@Param("condition") Comment condition);


}
